package com.heima.search.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.dtos.AssociateSearchDto;
import com.heima.model.search.dtos.HistorySearchDto;
import com.heima.search.pojos.ApAssociateWords;
import com.heima.search.pojos.ApUserSearch;
import com.heima.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author brianxia
 * @version 1.0
 * @date 2022-11-19 15:45
 */
@RestController
@RequestMapping("/api/v1/associate")
public class AssociateController {

    @Autowired
    private SearchService searchService;

    @PostMapping("/search")
    public ResponseResult search(@RequestBody AssociateSearchDto dto){
        List<ApAssociateWords> list = searchService.loadAssociate(dto);
        return ResponseResult.okResult(list);
    }

}
